/*--------------------------------------------------------------------------
  Project::MONDIALI SCI ALPINISMO
  Package::Gui
  Class::IconButton
  File IconButton.h
  --------------------------------------------------------------------------
  * METHODS AND CLASS PARAMETERS


  --------------------------------------------------------------------------
  * FUNCTIONS DESCRIPTION
  
	...

  --------------------------------------------------------------------------
  * COPYRIGHT

  --------------------------------------------------------------------------
  * INFO ABOUT AUTHOR AND VERSIONS
  Author:	Tino Giorgio	Data: 
  Rev1:			Data:

  --------------------------------------------------------------------------
  * E-MAIL & CONTACTS

  GIORGIO TINO:	tinoshi@libero.it
	           	shapeofangels@hotmail.com
	            giorgio.tino@studenti.polito.it

  --------------------------------------------------------------------------*/

#if !defined(ICONBUTTON_H)
#define ICONBUTTON_H

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <stdio.h>
#include <stdlib.h>

/* DEFINES */
#include "Defines.h"
#include "Bitmap.h"

/* OpenGL Includes */
#ifdef FREEGLUT_IS_PRESENT
#  include <GL/freeglut.h>
#else
#  ifdef __APPLE__
#    include <GLUT/glut.h>
#  else
#    include <GL/glut.h>
#  endif
#endif

#include <plib/ul.h>
#include <plib/pw.h>

class IconButton  
{
public:
	IconButton(GLuint tn);
	IconButton(GLuint tn,GLuint tf,GLuint tc);
	IconButton(float x_pos, float y_pos, float x_dim, float y_dim, GLuint tn, GLuint tf, GLuint tc);
	virtual ~IconButton();
	
	void display();
	
	int mouse(int b,int s,int x,int y);

	int selected();
	
	void bindTexture();

	void change();

	void set(float x, float y, float dim_x, float dim_y);
	
private:
    int mouseIsOver;
    int isSelected;
    
    // widget position
    float start_x;
    float start_y;
	float dim_x;
	float dim_y;

	GLuint texName[3];  
	
	bool one;
};

#endif // !defined(ICONBUTTON_H_)
